<template>
  <div class="muisc_main">
    <div class="muisc_item" v-for="(item, index) in muiscList" :key="index" @click="handleMusicItem(item.id)">
      <div class="muisc_item_content">
        <img :src="item.picUrl || item.coverImgUrl" alt="" />
        <!-- 数字 -->
        <div class="muisc_item_decorate">
          <div class="muisc_item_decorate_left">
            <i class="iconfont icon-erji"></i>
            <span>{{ item.playCount }}</span>
          </div>
          <div class="muisc_item_decorate_right">
            <div class="muisc_item_decorate_bg">
              <i class="iconfont icon-icon_play"></i>
            </div>
          </div>
        </div>
      </div>
      <div class="muisc_item_title">{{ item.name }}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Muisclist',
  props: {
    muiscList: {
      type: Array,
      default: function () {
        return []
      }
    }
  },
  data() {
    return {}
  },
  methods: {
    handleMusicItem(id) {
      this.$router.push('/musiclistdetail/' + id + '/' + new Date().getTime())
    }
  }
}
</script>

<style lang="less" scoped>
.muisc_main {
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  .muisc_item {
    width: 18%;
    cursor: pointer;
    margin-bottom: 10px;
    .muisc_item_content {
      width: 100%;
      position: relative;
      img {
        width: 100%;
      }
      .muisc_item_decorate {
        position: absolute;
        left: 0;
        bottom: 0;
        background: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4));
        width: 100%;
        height: 30px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .muisc_item_decorate_left {
          i {
            color: #fff;
            padding-right: 4px;
          }
          span {
            color: #fff;
            font-size: 14px;
          }
        }
        .muisc_item_decorate_right {
          padding-right: 20px;
          .muisc_item_decorate_bg {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: #fff;
            display: flex;
            justify-content: center;
            align-items: center;
            i {
              color: red;
            }
          }
        }
      }
    }
    .muisc_item_title {
      padding-top: 6px;
      font-size: 14px;
    }
  }
}
</style>
